﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright company="Microsoft Corporation" file="TranslationResult.cs">
//   Copyright © Microsoft Corporation.  All Rights Reserved.  
// This code released under the terms of the 
// Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)
// </copyright>
// <summary>
//   Result of a translation, of files and strings translated.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Microsoft.MCSUK.RESXTranslator
{
    /// <summary>
    /// Result of a translation request
    /// </summary>
    public struct TranslationResult
    {
        /// <summary>
        /// Gets or sets FileCount.
        /// </summary>
        public int FileCount { get; set; }

        /// <summary>
        /// Gets or sets StringCount.
        /// </summary>
        public int StringCount { get; set; }

        /// <summary>
        /// Gets or sets CharacterCount.
        /// </summary>
        public int CharacterCount { get; set; }

        /// <summary>
        /// Implements the '+' operator
        /// </summary>
        /// <param name="r1">Operator 1</param>
        /// <param name="r2">Operator 2</param>
        /// <returns>Result of '+' operation</returns>
        public static TranslationResult operator +(TranslationResult r1, TranslationResult r2)
        {
            return new TranslationResult
                { 
                    FileCount = r1.FileCount + r2.FileCount, 
                    StringCount = r1.StringCount + r2.StringCount, 
                    CharacterCount = r1.CharacterCount + r2.CharacterCount,
                };
        }
    }
}
